﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Text;
using OgilvyOne.BLL;
using OgilvyOne.Model;
using System.IO;

public partial class admin_allergy_doctor_FAQ_list : AdminBasePage
{
    public int isaudit = 0;
    public static readonly string ArticleVideoLayerids = OgilvyOne.Utility.ConfigUtil.GetStringValue("ArticleVideoLayerids");
    protected void Page_Load(object sender, EventArgs e)
    {
        //if (!IsPostBack)
        {
            //this.headers.Text = new ColumnBll().LayeridColumnConNaiv(Request.Params["layerid"]);
            Grid_viewBild();
        }
    }

    private void Grid_viewBild()
    {
        int pagesize = 10;

        if (Request.Params["pageNum"] != null && Request.Params["pageNum"] != "")
        {
            try
            {
                GridView1.PageIndex = int.Parse(Request.Params["pageNum"]) - 1;
            }
            catch { }
        }


        DataTable dt = BLLArticleInfo.getFAQ();
        GridView1.DataSource = dt;
        GridView1.PageSize = pagesize;
        GridView1.DataBind();
        this.pagehtml.Text = getPageHtml(GridView1.PageCount, GridView1.PageIndex + 1, dt.Rows.Count);
    }

    protected void Add_click(object sender, EventArgs e)
    {
        //this.PopedomValidate(Request.Params["layerid"], ADD);
        Response.Redirect("FAQ_add.aspx?columnid=" + Request.Params["columnid"] + "&layerid=" + Request.Params["layerid"], true);
    }

    protected void Del_click(object sender, EventArgs e)
    {

        Grid_viewBild();
    }

    protected void Delone_click(object sender, EventArgs e)
    {
        string id = ((LinkButton)sender).CommandArgument;
        BLLArticleInfo.delFaq(id);
        Response.Redirect("FAQ_list.aspx?columnid=" + Request.Params["columnid"] + "&layerid=" + Request.Params["layerid"], true);
        Grid_viewBild();
    }

    protected void Pub_click(object sender, EventArgs e)
    {

        Grid_viewBild();
    }

    protected void Pubone_click(object sender, EventArgs e)
    {
        string id = ((LinkButton)sender).CommandArgument;
        BLLArticleInfo.delFaq(id);
        Response.Redirect("FAQ_list.aspx?columnid=" + Request.Params["columnid"] + "&layerid=" + Request.Params["layerid"], true);
    }
    //撤消发布
    protected void RePubone_click(object sender, EventArgs e)
    {
        //this.PopedomValidate(Request.Params["layerid"], PUB);
        Grid_viewBild();
    }

    protected void Mod_click(object sender, EventArgs e)
    {
        //this.PopedomValidate(Request.Params["layerid"], MOD);
        Response.Redirect("FAQ_add.aspx?layerid=" + Request.Params["layerid"] + "&id=" + ((LinkButton)sender).CommandArgument, true);
    }
    protected void Seo_click(object sender, EventArgs e)
    {
        //this.PopedomValidate(Request.Params["layerid"], MOD);
        Response.Redirect("info_seo.aspx?columnid=" + Request.Params["columnid"] + "&layerid=" + Request.Params["layerid"] + "&id=" + ((LinkButton)sender).CommandArgument, true);
    }
    protected void Audit_click(object sender, EventArgs e)
    {
        //this.PopedomValidate(Request.Params["layerid"], AUDIT);
        Grid_viewBild();
    }
}

